
rnpgbe Linux* Base Driver for Mucse(R) Ethernet Network Connections
==================================================================

January 30, 2023

Contents
--------

- Overview
- Identifying Your Adapter
- Important Notes
- Building and Installation
- Command Line Parameters
- Additional Features and Configurations
- Known Issues/Troubleshooting
- Support
- DKMS support
- License


Overview
========
This driver supports kernel versions 2.6.x and newer. However, some features
may require a newer kernel version. The associated Virtual Function (VF) driver
for this driver is rnpgbevf.

Driver information can be obtained using ethtool, lspci, and ip. Instructions
on updating ethtool can be found in the section Additional Configurations later
in this document.

This driver is only supported as a loadable module at this time. Mucse is not
supplying patches against the kernel source to allow for static linking of the
drivers.

For questions related to hardware requirements, refer to the documentation
supplied with your Mucse adapter. All hardware requirements listed apply to use
with Linux.

Identifying Your Adapter
========================
The driver is compatible with devices based on the following:
  * Mucse(R) Ethernet Controller N500

For information on how to identify your adapter, and for the latest Mucse
network drivers, refer to the Mucse Support website:
http://www.mucse.com/support


Important Notes
===============

Do not unload port driver if VF with active VM is bound to it
-------------------------------------------------------------
Do not unload a port's driver if a Virtual Function (VF) with an active Virtual
Machine (VM) is bound to it. Doing so will cause the port to appear to hang.
Once the VM shuts down, or otherwise releases the VF, the command will complete.


Building and Installation
=========================

To manually build the driver
----------------------------
1. Move the base driver tar file to the directory of your choice.
   For example, use '/home/username/rnpgbe' or '/usr/local/src/rnpgbe'.

2. Untar/unzip the archive, where <x.x.x> is the version number for the
   driver tar file:

   # tar zxf rnpgbe-<x.x.x>.tar.gz

3. Change to the driver src directory, where <x.x.x> is the version number
   for the driver tar:

   # cd rnpgbe-<x.x.x>/src/

4. Compile the driver module:

   # make install

   The binary will be installed as:
   /lib/modules/<KERNEL VER>/updates/drivers/net/ethernet/mucse/rnpgbe/rnpgbe.ko

   The install location listed above is the default location. This may differ
   for various Linux distributions.

5. Load the module using the modprobe command.

   To check the version of the driver and then load it:

   # modinfo rnpgbe
   # modprobe rnpgbe [parameter=port1_value,port2_value]

   Alternately, make sure that any older rnpgbe drivers are removed from the
   kernel before loading the new module:

   # rmmod rnpgbe; modprobe rnpgbe

6. Assign an IP address to the interface by entering the following,
   where <ethX> is the interface name that was shown in dmesg after modprobe:

   # ip address add <IP_address>/<netmask bits> dev <ethX>

7. Verify that the interface works. Enter the following, where IP_address
   is the IP address for another machine on the same subnet as the interface
   that is being tested:

   # ping <IP_address>

Note: For certain distributions like (but not limited to) Red Hat Enterprise
Linux 7 and Ubuntu, once the driver is installed, you may need to update the
initrd/initramfs file to prevent the OS loading old versions of the rnpgbe
driver.
   For Red Hat distributions:
	# dracut --force

   For Ubuntu:
	# update-initramfs -u

 
To build a binary RPM package of this driver
--------------------------------------------
Note: RPM functionality has only been tested in Red Hat distributions.

1. Run the following command, where <x.x.x> is the version number for the
   driver tar file.

   # rpmbuild -tb rnpgbe-<x.x.x>.tar.gz

   NOTE: For the build to work properly, the currently running kernel MUST
   match the version and configuration of the installed kernel sources. If
   you have just recompiled the kernel, reboot the system before building.

2. After building the RPM, the last few lines of the tool output contain the
   location of the RPM file that was built. Install the RPM with one of the
   following commands, where <RPM> is the location of the RPM file:

   # rpm -Uvh <RPM>
       or
   # dnf/yum localinstall <RPM>

NOTES:
- To compile the driver on some kernel/arch combinations, you may need to
install a package with the development version of libelf (e.g. libelf-dev,
libelf-devel, elfutilsl-libelf-devel).
- When compiling an out-of-tree driver, details will vary by distribution.
However, you will usually need a kernel-devel RPM or some RPM that provides the
kernel headers at a minimum. The RPM kernel-devel will usually fill in the link
at /lib/modules/'uname -r'/build.


To build with kernel source of this driver
--------------------------------------------

1. Untar/unzip the archive, where <x.x.x> is the version number for the
   driver tar file:

   # tar zxf rnpgbe-<x.x.x>.tar.gz

2. Move the driver file to the directory of your kernel source:

   # cp -rf rnpgbe-<x.x.x>/src/  kernel_source/drivers/net/ethernet/mucse/rnpgbe/

NOTE: Use 'mkdir' if folder not exist.

3. Move the kconfig file to the directory of your kernel source

   # cp rnpgbe-<x.x.x>/kconfig_file kernel_source/drivers/net/ethernet/mucse

4. Use makefile.example to cover Makefile in drivers

   # cd kernel_source/drivers/net/ethernet/mucse/rnpgbe/
   # cp makefile.example Makefile

5. Generate kcompat_generated_defs.h

   // edit kcompat-generator.sh (remove '#' before KSRC, CONFFILE and OUT):
   // locate your kernel src, such as /home/kernel
   // locate your autoconf.h, such as /home/kernel/include.generated/autoconf.h
   // define output file name kcompat-generator.sh
   KSRC=/home/kernel/
   CONFFILE=/home/kernel/include.generated/autoconf.h
   OUT=kcompat_generated_defs.h
   # ./kcompat-generator.sh

6. Then you can config mucse driver with 'make menuconf'


Command Line Parameters
=======================
If the driver is built as a module, enter optional parameters on the command
line with the following syntax:

# modprobe rnpgbe [<option>=<VAL1>,<VAL2>,...]

There needs to be a <VAL#> for each network port in the system supported by
this driver. The values will be applied to each instance, in function order.
For example:

pf_msix_counts_set
------
Valid Range: 2-64
pf_msix_counts_set controls max msix number can be used for each pf. It is useful
in some conditions (small msix number with large CPU numbers (which driver will 
try to use more msix).

IntMode
-------
Valid Range: 0-2 (0 = Legacy Int, 1 = MSI and 2 = MSI-X)
IntMode controls the allowed load time control over the type of interrupt
registered for by the driver. MSI-X is required for multiple queue
support, and some kernels and combinations of kernel .config options
will force a lower level of interrupt support.
'cat /proc/interrupts' will show different values for each type of interrupt.

NOTE: n500 supports 0/1/2.

max_vfs
-------
This parameter adds support for SR-IOV. It causes the driver to spawn up to
max_vfs worth of virtual functions.
Valid Range:  1-63
If the value is greater than 0 it will also force the VMDq parameter to be 1 or
more.

NOTE: This parameter is only used on kernel 3.7.x and below. On kernel 3.8.x
and above, use sysfs to enable VFs. Use sysfs for Red Hat distributions.

For example, you can create 4 VFs as follows:

# echo 4 > /sys/class/net/<ethX>/device/sriov_numvfs

To disable VFs, write 0 to the same file:

# echo 0 > /sys/class/net/<ethX>/device/sriov_numvfs

The parameters for the driver are referenced by position. Thus, if you have a
dual port adapter, or more than one adapter in your system, and want N virtual
functions per port, you must specify a number for each port with each parameter
separated by a comma. For example:

# modprobe rnpgbe max_vfs=4

This will spawn 4 VFs on the first port.

# modprobe rnpgbe max_vfs=2,4

This will spawn 2 VFs on the first port and 4 VFs on the second port.

NOTE: Caution must be used in loading the driver with these parameters.
Depending on your system configuration, number of slots, etc., it is impossible
to predict in all cases where the positions would be on the command line.

NOTE: Neither the device nor the driver control how VFs are mapped into config
space. Bus layout will vary by operating system. On operating systems that
support it, you can check sysfs to find the mapping.

NOTE: When either SR-IOV mode, hardware VLAN filtering
and VLAN tag stripping/insertion will remain enabled. Please remove the old
VLAN filter before the new VLAN filter is added. For example:

# ip link set eth0 vf 0 vlan 100	// set vlan 100 for VF 0
# ip link set eth0 vf 0 vlan 0	        // Delete vlan 100
# ip link set eth0 vf 0 vlan 200	// set a new vlan 200 for VF 0

With kernel 3.6, the driver supports the simultaneous usage of max_vfs and DCB
features, subject to the constraints described below. Prior to kernel 3.6, the
driver did not support the simultaneous operation of max_vfs greater than 0 and
the DCB features (multiple traffic classes utilizing Priority Flow Control and
Extended Transmission Selection).

NOTE: For each PF, In ARI mode: n500 support 7 vfs;
      In no-ARI mode: n500 support 1 vfs;



Additional Features and Configurations
======================================

ethtool
-------
The driver utilizes the ethtool interface for driver configuration and
diagnostics, as well as displaying statistical information. The latest ethtool
version is required for this functionality. Download it at:
https://kernel.org/pub/software/network/ethtool/


Configuring the Driver on Different Distributions
-------------------------------------------------
Configuring a network driver to load properly when the system is started is
distribution dependent. Typically, the configuration process involves adding an
alias line to /etc/modules.conf or /etc/modprobe.conf as well as editing other
system startup scripts and/or configuration files. Many popular Linux
distributions ship with tools to make these changes for you. To learn the
proper way to configure a network device for your system, refer to your
distribution documentation. If during this process you are asked for the driver
or module name, the name for the Base Driver is rnpgbe.

For example, if you install the rnpgbe driver for two adapters (eth0 and eth1)
and want to set the interrupt mode to MSI-X and MSI, respectively, add the
following to modules.conf or /etc/modprobe.conf:
  alias eth0 rnpgbe
  alias eth1 rnpgbe
  options rnpgbe irq_mode=2,1,2,1


Viewing Link Messages
---------------------
Link messages will not be displayed to the console if the distribution is
restricting system messages. In order to see network driver link messages on
your console, set dmesg to eight by entering the following:

# dmesg -n 8

NOTE: This setting is not saved across reboots.


Jumbo Frames
------------
Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU)
to a value larger than the default value of 1500.

Use the ip command to increase the MTU size. For example, enter the following
where <ethX> is the interface number:

# ip link set mtu 9000 dev <ethX>
# ip link set up dev <ethX>

This setting is not saved across reboots.

Add 'MTU=9000' to the following file to make the setting change permanent:
  /etc/sysconfig/network-scripts/ifcfg-<ethX> for RHEL
      or
  /etc/sysconfig/network/<config_file> for SLES

NOTE: The maximum MTU setting for jumbo frames is 9696(n500). 
This corresponds to the maximum jumbo frame size of 9718(n500) bytes.

NOTE: This driver will attempt to use multiple page sized buffers to receive
each jumbo packet. This should help to avoid buffer starvation issues when
allocating receive packets.

NOTE: Packet loss may have a greater impact on throughput when you use jumbo
frames. If you observe a drop in performance after enabling jumbo frames,
enabling flow control may mitigate the issue.

NOTE: If you are enabling jumbo frames in a virtual function (VF), jumbo frames must 
first be enabled in the physical function (PF). The VF MTU setting cannot be larger 
than the PF MTU.


Speed and Duplex Configuration
------------------------------
In addressing speed and duplex configuration issues, you need to distinguish
between copper-based adapters and fiber-based adapters.

In the default mode, an Mucse(R) Ethernet Network Adapter using copper
connections will attempt to auto-negotiate with its link partner to determine
the best setting. If the adapter cannot establish link with the link partner
using auto-negotiation, you may need to manually configure the adapter and link
partner to identical settings to establish link and pass packets. This should
only be needed when attempting to link with an older switch that does not
support auto-negotiation or one that has been forced to a specific speed or
duplex mode. Your link partner must match the setting you choose. 1 Gbps speeds
and higher cannot be forced. Use the autonegotiation advertising setting to
manually set devices for 1 Gbps and higher.

Speed, duplex, and autonegotiation advertising are configured through the
ethtool utility.

To see the speed configurations your device supports, run the following:

# ethtool <ethX>

 To have your device advertise these speeds, use
the following:

# ethtool -s <ethX> advertise N

Where N is a combination of the following.
100baseTFull   0x008
1000baseTFull  0x020
2500baseTFull  0x800000000000
5000baseTFull  0x1000000000000
10000baseTFull 0x1000

For example, to turn on all modes:
# ethtool -s <ethX> advertise 0x1800000001028

For more details please refer to the ethtool man page.

NOTE: On Linux systems with INTERFACES(5), this can be specified as a pre-up
command in /etc/network/interfaces so that the interface is always brought up
with NBASE-T support. For example:

# iface <ethX> inet dhcp
    pre-up ethtool -s <ethX> advertise 0x1800000001028 || true

Caution: Only experienced network administrators should force speed and duplex
or change autonegotiation advertising manually. The settings at the switch must
always match the adapter settings. Adapter performance may suffer or your
adapter may not operate if you configure the adapter differently from your
switch.

An Mucse(R) Ethernet Network Adapter using fiber-based connections, however,
will not attempt to auto-negotiate with its link partner since those adapters
operate only in full duplex and only at their native speed.

NOTE:For the Mucse(R) Ethernet Connection n500 (with tp) can sutup speed and duplex 
manually.


Link-Level Flow Control (LFC)
-----------------------------
Ethernet Flow Control (IEEE 802.3x) can be configured with ethtool to enable
receiving and transmitting pause frames for rnpgbe. When transmit is enabled,
pause frames are generated when the receive packet buffer crosses a predefined
threshold. When receive is enabled, the transmit unit will halt for the time
delay specified when a pause frame is received.

NOTE: You must have a flow control capable link partner.

Flow Control is enabled by default.

Use ethtool to change the flow control settings.

To enable or disable Rx or Tx Flow Control:

# ethtool -A <ethX> rx <on|off> tx <on|off>

Note: This command only enables or disables Flow Control if auto-negotiation is
disabled. If auto-negotiation is enabled, this command changes the parameters
used for auto-negotiation with the link partner.

To enable or disable auto-negotiation:

# ethtool -s <ethX> autoneg <on|off>

NOTE: Flow Control auto-negotiation is part of link auto-negotiation. Depending
on your device, you may not be able to change the auto-negotiation setting.

NOTE:
- The rnpgbe driver requires flow control on both the port and link partner. If
flow control is disabled on one of the sides, the port may appear to hang on
heavy traffic.

NOTE: n500 with fiber cannot support autoneg; autoneg only valid with 
TP.

Mucse(R) Ethernet Flow Director
-------------------------------
The Mucse(R) Ethernet Flow Director (Mucse(R) Ethernet FD) performs the
following tasks:

- Directs receive packets according to their flows to different queues
- Enables tight control on routing a flow in the platform
- Matches flows and CPU cores for flow affinity
- Supports multiple parameters for flexible flow classification and load
  balancing (in SFP mode only)

NOTE: An included script (set_irq_affinity) automates setting the IRQ to CPU
affinity.

NOTE: This driver supports the following flow types:
- layer2 protocol
- 5 tuple
Each flow type supports valid combinations of IP addresses (source or
destination) and UDP/TCP ports (source and destination). You can supply only a
source IP address, a source IP address and a destination port, or any
combination of one or more of these four parameters. 
NOTE: This driver does not
support IPv6 source or destination IP addresses.

The following table summarizes supported Mucse Ethernet Flow Director features
across Mucse(R) Ethernet controllers.

---------------------------------------------------------------------------
Feature             N500 Series
===========================================================================
VF FLOW DIRECTOR    Supported 
---------------------------------------------------------------------------
L2 PROTOCOL         Supported
---------------------------------------------------------------------------
5 tuple             supported 
---------------------------------------------------------------------------

Sideband Perfect Filters
------------------------
Sideband Perfect Filters are used to direct traffic that matches specified
characteristics. They are enabled through ethtool's ntuple interface. To enable
or disable the Mucse Ethernet Flow Director and these filters:

# ethtool -K <ethX> ntuple <off|on>

NOTE: When you disable ntuple filters, all the user programmed filters are
flushed from the driver cache and hardware. All needed filters must be re-added
when ntuple is re-enabled.

To display all of the active filters:

# ethtool -u <ethX>

To add a new filter:

# ethtool -U <ethX> flow-type <type> src-ip <ip> [m <ip_mask>] dst-ip <ip> [m
<ip_mask>] src-port <port> [m <port_mask>] dst-port <port> [m <port_mask>]
action <queue>
  Where:
    <ethX> - the Ethernet device to program
    <type> - can be ip4, tcp4, udp4, sctp4, tcp6, udp6
    <ip> - the IP address to match on
    <ip_mask> - the IPv4 address to mask on
              NOTE: These filters use inverted masks.
    <port> - the port number to match on
    <port_mask> - the 16-bit integer for masking
              NOTE: These filters use inverted masks.
    <queue> - the queue to direct traffic toward (-1 discards the
              matched traffic)

To delete a filter:

# ethtool -U <ethX> delete <N>
  Where <N> is the filter ID displayed when printing all the active filters,
  and may also have been specified using "loc <N>" when adding the filter.

NOTE: Mucse Ethernet Flow Director masking works in the opposite manner from
subnet masking. For instance, in the following command:
NOTE: Filter not support bit mask in no TCAM mode (ethtool -n <ethX> return
4K more means TCAM mode)

# ethtool -U eth11 flow-type ip4 src-ip 172.4.1.2 dst-ip \
172.21.1.1  action 31


EXAMPLES:
To add a filter that directs packet to queue 2:

# ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
192.168.10.2 src-port 2000 dst-port 2001 action 2 [loc 1]

To set a filter using only the source and destination IP address:

# ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
192.168.10.2 action 2 [loc 1]

To match TCP traffic sent from 192.168.0.1, port 5300, directed to 192.168.0.5,
port 80, and then send it to queue 7:

# ethtool -U enp130s0 flow-type tcp4 src-ip 192.168.0.1 dst-ip 192.168.0.5
src-port 5300 dst-port 80 action 7

To add a TCPv4 filter with a partial mask for a source IP subnet:

# ethtool -U <ethX> flow-type tcp4 src-ip 192.168.0.0 m 0.255.255.255 dst-ip
192.168.5.12 src-port 12600 dst-port 31 action 12

NOTE:
For each flow-type, the programmed filters must all have the same matching
input set. For example, issuing the following two commands is acceptable:

# ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
# ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.5 src-port 55 action 10

Issuing the next two commands, however, is not acceptable, since the first
specifies src-ip and the second specifies dst-ip:

# ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
# ethtool -U enp130s0 flow-type ip4 dst-ip 192.168.0.5 src-port 55 action 10

The second command will fail with an error. You may program multiple filters
with the same fields, using different values, but, on one device, you may not
program two tcp4 filters with different matching fields.

The rnpgbe driver does not support matching on a subportion of a field, thus
partial mask fields are not supported.


Filters to Direct Traffic to a Specific VF
------------------------------------------
It is possible to create filters that direct traffic to a specific Virtual
Function. For older versions of ethtool, this depends on the "action"
parameter. Specify the action as a 64-bit value, where the lower 32 bits
represent the queue number, while the next 8 bits represent the VF ID. Note
that 0 is the PF, so the VF identifier is offset by 1. For example:

# ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
192.168.10.2 src-port 2000 dst-port 2001 action 0x800000002 [loc 1]

The action field specifies to direct traffic to Virtual Function 7 (8 minus 1)
into queue 2 of that VF.

Newer versions of ethtool (version 4.11 and later) use "vf" and "queue"
parameters instead of the "action" parameter. Note that using the new ethtool
"vf" parameter does not require the value to be offset by 1. This command is
equivalent to the above example:

# ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
192.168.10.2 src-port 2000 dst-port 2001 vf 7 queue 2 [loc 1]

Note that these filters will not break internal routing rules, and will not
route traffic that otherwise would not have been sent to the specified VF.

Support for UDP RSS
-------------------

This feature adds an ON/OFF switch for hashing over certain flow types. Only
UDP can be turned on. The default setting is disabled.

Only support for enabling/disabling hashing on ports for UDP over IPv4 (UDP4) or
IPv6 (UDP6) is supported.

NOTE: Fragmented packets may arrive out of order when RSS UDP support is
configured.

Supported Ethtool Commands and Options:
  -n --show-nfc
    Retrieves the receive network flow classification configurations.
  rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6
    Retrieves the hash options for the specified network traffic type.
  -N --config-nfc
    Configures the receive network flow classification.
  rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6
  m|v|t|s|d|f|n|r...
    Configures the hash options for the specified network traffic type.
      udp4    UDP over IPv4
      udp6    UDP over IPv6
      f       Hash on bytes 0 and 1 of the Layer 4 header of the Rx packet.
      n       Hash on bytes 2 and 3 of the Layer 4 header of the Rx packet.

The following is an example using udp4 (UDP over IPv4):
  - To include UDP port numbers in RSS hashing run:
    # ethtool -N <ethX> rx-flow-hash udp4 sdfn

  - To exclude UDP port numbers from RSS hashing run:
    # ethtool -N <ethX> rx-flow-hash udp4 sd

  - To display UDP hashing current configuration run:
    # ethtool -n <ethX> rx-flow-hash udp4

The results of running that call will be the following, if UDP hashing is
enabled.

  UDP over IPV4 flows use these fields for computing Hash flow key:
    IP SA
    IP DA
    L4 bytes 0 & 1 [TCP/UDP src port]
    L4 bytes 2 & 3 [TCP/UDP dst port]

The results if UDP hashing is disabled are shown below.
  UDP over IPV4 flows use these fields for computing Hash flow key:
    IP SA
    IP DA

Parameters FdirPballoc and AtrSampleRate impact Mucse Ethernet Flow Director.


Configuring VLAN Tagging on SR-IOV Enabled Adapter Ports
--------------------------------------------------------
To configure VLAN tagging for the ports on an SR-IOV enabled adapter, use the
following command. The VLAN configuration should be done before the VF driver
is loaded or the VM is booted. The VF is not aware of the VLAN tag being
inserted on transmit and removed on received frames (sometimes called "port
VLAN" mode).

# ip link set dev <ethX> vf <id> vlan <vlan id>

For example, the following will configure PF eth0 and the first VF on VLAN 10:

# ip link set dev eth0 vf 0 vlan 10

NOTE: only 1 vlan for each VF.


Setting MAC Address, VLAN, and Rate Limit Using IProute2 Tool
------------------------------------------------------------
You can set a MAC address of a Virtual Function (VF), a default VLAN, and the
rate limit using the IProute2 tool. Download the latest version of the
IProute2 tool from Sourceforge if your version does not have all the features
you require.


Wake on LAN (WoL) Support
-------------------------
Some adapters do not support Wake on LAN (WoL). To determine if your adapter
supports WoL, run the following command:

# ethtool <ethX>

WoL is configured through the ethtool utility. If your Linux distribution does
not include ethtool, download and install it from the following website:
https://kernel.org/pub/software/network/ethtool/.

For instructions on enabling WoL with ethtool, refer to the website listed
above.

WoL will be enabled on the system during the next shutdown or reboot. For this
driver version, in order to enable WoL, the rnpgbe driver must be loaded prior
to shutting down or suspending the system.


IEEE 1588 Precision Time Protocol (PTP) Hardware Clock (PHC)
------------------------------------------------------------
Precision Time Protocol (PTP) is used to synchronize clocks in a computer
network. PTP support varies among Mucse devices that support this driver. Use
'ethtool -T <ethX>' to get a definitive list of PTP capabilities supported by
the device.


Tunnel/Overlay Stateless Offloads
---------------------------------
Supported tunnels and overlays include VXLAN, GENEVE, and others depending on
hardware and software configuration. Stateless offloads are enabled by default.
 
To view the current state of all offloads:

# ethtool -k <ethX>


Interrupt Rate Limiting
-----------------------
This driver supports an adaptive interrupt throttle rate (ITR) mechanism that
is tuned for general workloads. The user can customize the interrupt rate
control for specific workloads, via ethtool, adjusting the number of
microseconds between interrupts.

Syntax:

# ethtool -C <ethX> rx-usecs N

  2-1022 - minimum microseconds between each interrupt

The range of 0-1022 microseconds provides an effective range of 978 to 500,000
interrupts per second. The underlying hardware supports granularity in 2us
intervals at 1Gbps and 10Gbps and 20us at 100Mbps, so adjacent values may
result in the same interrupt rate.

For lower CPU utilization:
 - Lower Rx and Tx interrupts per queue using ethtool.

 - Setting rx-usecs to 125 will limit interrupts to about 8,000 interrupts
   per second per queue:

   # ethtool -C <ethX> rx-usecs 125

For reduced latency:
 - Disable ITR by setting rx-usecs to 0 using ethtool:

   # ethtool -C <ethX> rx-usecs 0



Known Issues/Troubleshooting
============================

Hardware Issues
---------------
For known hardware and troubleshooting issues, either refer to the "Release
Notes" in your User Guide, or for more detailed information, go to
http://www.mucse.com.

In the search box enter your devices controller ID followed by "spec update"
(i.e., N500 spec update). The specification update file has complete
information on known hardware issues.


Software Issues
---------------
NOTE: After installing the driver, if your Mucse Ethernet Network Connection
is not working, verify that you have installed the correct driver.

Mucse(R) Active Management Technology 2.0, 2.1, 2.5 are not supported in
conjunction with the linux driver.


Receive Error counts may be higher than the actual packet error count
---------------------------------------------------------------------
When a packet is received with more than one error, two bad packets may be
reported. This affects all devices based on 10G, or faster, controllers.


MAC address of Virtual Function changes unexpectedly
----------------------------------------------------
If a Virtual Function's MAC address is not assigned in the host, then the VF
(virtual function) driver will use a random MAC address. This random MAC
address may change each time the VF driver is reloaded. You can assign a static
MAC address in the host machine. This static MAC address will survive a VF
driver reload.


SR-IOV virtual functions have identical MAC addresses
-----------------------------------------------------
When you create multiple SR-IOV virtual functions, the VFs may have identical
MAC addresses. Only one VF will pass traffic, and all traffic on other VFs with
identical MAC addresses will fail. This is related to the
"MACAddressPolicy=persistent" setting in
/usr/lib/systemd/network/99-default.link.

To resolve this issue, edit the /usr/lib/systemd/network/99-default.link file
and change the MACAddressPolicy line to "MACAddressPolicy=none". For more
information, see the systemd.link man page.


Multiple Interfaces on Same Ethernet Broadcast Network
------------------------------------------------------
Due to the default ARP behavior on Linux, it is not possible to have one system
on two IP networks in the same Ethernet broadcast domain (non-partitioned
switch) behave as expected. All Ethernet interfaces will respond to IP traffic
for any IP address assigned to the system. This results in unbalanced receive
traffic.

If you have multiple interfaces in a server, either turn on ARP filtering by
entering the following:

# echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter

This only works if your kernel's version is higher than 2.4.5.

NOTE: This setting is not saved across reboots. The configuration change can be
made permanent by adding the following line to the file /etc/sysctl.conf:

  net.ipv4.conf.all.arp_filter = 1

Another alternative is to install the interfaces in separate broadcast domains
(either in different switches or in a switch partitioned to VLANs).


UDP Stress Test Dropped Packet Issue
------------------------------------
Under small packet UDP stress with the rnpgbe driver, the system may drop UDP
packets due to socket buffers being full. Setting the driver Mucse Ethernet
Flow Control variables to the minimum may resolve the issue. You may also try
increasing the kernel's default buffer sizes by changing the values in

  /proc/sys/net/core/rmem_default and rmem_max

Rx Page Allocation Errors
-------------------------
'Page allocation failure. order:0' errors may occur under stress with kernels
2.6.25 and newer. This is caused by the way the Linux kernel reports this
stressed condition.


Lower than expected performance
-------------------------------
Some PCIe x8 slots are actually configured as x4 slots. These slots have
insufficient bandwidth for full line rate with dual port and quad port devices.
In addition, if you put a PCIe v4.0 or v3.0-capable adapter into a PCIe v2.x
slot, you cannot get full bandwidth. The driver detects this situation and
writes one of the following messages in the system log:

"PCI-Express bandwidth available for this card is not sufficient for optimal
performance. For optimal performance a x8 PCI-Express slot is required."
  or
"PCI-Express bandwidth available for this device may be insufficient for
optimal performance. Please move the device to a different PCI-e link with more
lanes and/or higher transfer rate."

If this error occurs, moving your adapter to a true PCIe v3.0 x8 slot will
resolve the issue.


Running ethtool -t <ethX> command causes break between PF and test client
-----------------------------------------------------------------------
When there are active VFs, "ethtool -t" will only run the link test. The driver
will also log in syslog that VFs should be shut down to run a full diagnostic
test.


Unable to obtain DHCP lease on boot with Red Hat
-----------------------------------------------
In configurations where the auto-negotiation process takes more than 5 seconds,
the boot script may fail with the following message:
"<ethX>: failed. No link present. Check cable?"

This error may occur even though the presence of link can be confirmed using
ethtool <ethX>. In this case, try setting "LINKDELAY=30" in
/etc/sysconfig/network-scripts/ifdfg-<ethX>.

The same issue can occur during a network boot (via PXE) on Red Hat
distributions that use the dracut script:
"Warning: No carrier detected on interface <ethX>"

In this case add "rd.net.timeout.carrier=30" at the kernel command line.

NOTE: Link time can vary. Adjust LINKDELAY value accordingly.


Host May Reboot after Removing PF when VF is Active in Guest
------------------------------------------------------------
Using kernel versions earlier than 3.2, do not unload the PF driver with
active VFs. Doing this will cause your VFs to stop working until you reload
the PF driver and may cause a spontaneous reboot of your system.

Prior to unloading the PF driver, you must first ensure that all VFs are
no longer active. Do this by shutting down all VMs and unloading the VF driver.


Out of memory issues on IA32 systems
------------------------------------

The driver may consume a lot of memory based on the number of CPUs and network
interfaces. This leads to memory segmentation. Thus, the driver may not be
able to allocate enough memory. To resolve this, reduce the number of
descriptors using ethtool -G or the number of queues through the RSS parameter.


VLAN tags are stripped on kernels earlier than 2.6.36
-----------------------------------------------------

In order to support DCB, kernels earlier than 2.6.36 strip VLAN tags for
VLAN0. This ensures connectivity using 802.1p frames between kernels that
have built-in support and kernels that do not.


Support
=======
For general information, go to the Mucse support website at:
http://www.mucse.com/support/


DKMS support
=======
You can setup dkms as below
cd scripts
chmod +x generate_dkms_conf.sh
chmod +x dkms-install.sh
chmod +x dkms-remove.sh
./generate_dkms_conf.sh
./dkms-install.sh

You can generate deb after install
dkms mkdeb -m rnpgbe -v xxx
deb file is in /var/lib/dkms/rnpgbe/xx/deb/


License
=======
This program is free software; you can redistribute it and/or modify it under
the terms and conditions of the GNU General Public License, version 2, as
published by the Free Software Foundation.

This program is distributed in the hope it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St - Fifth Floor, Boston, MA 02110-1301 USA.

The full GNU General Public License is included in this distribution in the
file called "COPYING".

Copyright(c) 1999 - 2023 Mucse Corporation.


Trademarks
==========
Mucse is a trademark or registered trademark of Mucse Corporation or its
subsidiaries in the United States and/or other countries.

* Other names and brands may be claimed as the property of others.


